#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;


class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        
        int i = 0;
        int sum_zero = 0;
        while (i < nums.size()) {
            if (nums[i] == 0) {
                nums.erase(nums.begin() + i);
                sum_zero++;
            }
            else {
                i = i + 1;
            }
        }
        for (int j = 0; j < sum_zero; j++) {
            nums.push_back(0);
        }
        
        
                     
    }
};


//int main() {
//    vector<int> nums = { 0,1,0,3,12 };
//    Solution S;
//    S.moveZeroes(nums);
//    return 0;
//}
